package com.ie.controller.before;

import com.ie.common.http.ResponseResult;
import com.ie.common.security.anno.AuthIgrone;
import com.ie.entity.CartEntity;
import com.ie.service.admin.GoodsService;
import com.ie.service.before.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @classname: CartController
 * @Author: S2
 * @Description: //TODO
 * @Date: 2025/5/29  10:31
 * @Param:
 * @version: 1.0
 **/
@RestController
@RequestMapping("/api/before/cart")
public class CartController {
    @Autowired
    private CartService cartService;
    @Autowired
    private GoodsService goodsService;
@AuthIgrone//TODO debug
    @PostMapping("/add")
    public ResponseResult<Map<String, Object>> addCart(@RequestBody CartEntity cartEntity) {
        return cartService.addCart(cartEntity);
    }
    @AuthIgrone//TODO debug
    @PostMapping("/bupDateCart")
    ResponseResult<Map<String, Object>> bupDateCart(@RequestBody CartEntity cartEntity){
        return cartService.bupDateCart(cartEntity);
    }


}
